<?php /* SVN: $Id: index_list.ctp 99 2008-07-09 09:33:42Z rajesh_04ag02 $ */ ?>
<div class="blogs reports">
<h2><?php echo __l('Manage Updates Reports');?></h2>
<div class="count-block">
<?php echo $this->Html->link(__l('All') . ' (' . $reports . ')'), array('controller' => 'blogs', 'action' => 'index', 'reports')); ?>
</div>
<?php
	echo $this->element('paging_counter');
	echo $this->Form->create('BlogReport' , array('class' => 'normal','action' => 'move_to'));
?>
<table class="list">
	<tr>
		<th><?php echo $this->Paginator->sort(__l('Title'), 'title');?></th>
	</tr>
<?php
if (!empty($blogs)):

$i = 0;
foreach ($blogs as $blog):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
	if($blog['Blog']['is_published']):
		$status_class = 'js-checkbox-active';
	else:
		$status_class = 'js-checkbox-inactive';
	endif;
?>
	<tr<?php echo $class;?>>
        <td><?php echo $this->Html->link($this->Html->cText($blog['Blog']['title']), array('controller' => 'blogs', 'action' => 'view', $blog['Blog']['slug'], 'admin' => false), array('escape' => false));?></td>
	</tr>
	<tr>
		<td>
			<h3><?php echo __l('Reports'); ?></h3>
			<table class="list">
				<tr>
					<th><?php echo __l('Select'); ?></th>
					<th><?php echo __l('Reported By'); ?></th>
					<th><?php echo __l('Reported As'); ?></th>
					<th><?php echo __l('Description'); ?></th>
				</tr>
				<?php
					if (!empty($blog['BlogReport'])) {
						foreach($blog['BlogReport'] as $report)
							{
							$status_class = 'js-checkbox-active';
?>
					<tr>
						<td><?php echo $this->Form->input('BlogReport.Id.'.$report['id'].'.Check', array('type' => 'checkbox', 'id' => "admin_checkbox_".$report['id'], 'label' => false, 'class' => $status_class.' checkbox-list')); ?></td>
						<td><?php echo $this->Html->link($this->Html->cText($report['User']['username']), array('controller'=> 'users', 'action' => 'view', $report['User']['username'], 'admin' => false), array('escape' => false));?></td>
						<td><?php echo $this->Html->link($this->Html->cText($report['ReportType']['name']), array('controller'=> 'users', 'action' => 'view', $report['User']['username'], 'admin' => false), array('escape' => false));?> </td>
						<td><?php echo $this->Html->link($this->Html->cText($report['description']), array('controller'=> 'users', 'action' => 'view', $report['User']['username'], 'admin' => false), array('escape' => false));?></td>
					</tr>
<?php
							}
					}
					else {
?>
				<tr>
					<td colspan="4"><?php echo __l('No reports available');?></td>
				</tr>
<?php
					}
				?>
			</table>
		</td>
	</tr>
<?php
    endforeach;
else:
?>
	<tr class="notice">
		<td class="notice" colspan="6"><?php echo __l('No Updates available');?></td>
	</tr>
<?php
endif;
?>
</table>
<?php
if (!empty($blogs)):
?>
	<div class="select-block">
		<?php echo __l('Select:'); ?>
		<?php echo $this->Html->link(__l('All'), '#', array('class' => 'js-admin-select-all')); ?>
		<?php echo $this->Html->link(__l('None'), '#', array('class' => 'js-admin-select-none')); ?>
	</div>
	<div class="inline-submit-buttons">
<?php
	echo $this->Form->submit(__l('Delete'), array('name' => 'data[BlogReport][makeDelete]', 'class' =>'js-admin-action'));
?>
	</div>
	<?php
	echo $this->element('paging_links');
?>
<?php
endif;
echo $this->Form->end();
?>
</div>